﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Dycox
{
    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
    public sealed class BooleanTextAttribute : Attribute
    {
        public BooleanTextAttribute(string trueText, string falseText)
        {
            _trueText = trueText;
            _falseText = falseText;
        }

        private string _trueText;

        public string TrueText
        {
            get { return _trueText ?? DefaultTrueText; }
        }

        private string _falseText;

        public string FalseText
        {
            get { return _falseText ?? DefaultFalseText; }
        }

        public static string DefaultTrueText
        {
            get
            {
                return SR.GetString("default_true_text");
            }
        }

        public static string DefaultFalseText
        {
            get
            {
                return SR.GetString("default_false_text");
            }
        }

        public static readonly BooleanTextAttribute Default = new BooleanTextAttribute(null, null);
    }
}
